//! Plugin registry implementation

use crate::models::Value;
use std::collections::HashMap;

/// Plugin registry
#[derive(Debug)]
pub struct PluginRegistry {
    /// Registered plugins
    plugins: HashMap<String, Value>,
}

impl PluginRegistry {
    /// Create new plugin registry
    pub fn new() -> Self {
        Self {
            plugins: HashMap::new(),
        }
    }

    /// Register a plugin
    pub fn register_plugin(&mut self, name: String, info: Value) {
        self.plugins.insert(name, info);
    }

    /// Get plugin information
    pub fn get_plugin_info(&self, name: &str) -> Option<&Value> {
        self.plugins.get(name)
    }

    /// List all registered plugins
    pub fn list_plugins(&self) -> Vec<&String> {
        self.plugins.keys().collect()
    }
}
